//
//  UIView+Shadow.m
//  Shadow Maker Example
//
//  Created by Philip Yu on 5/14/13.
//  Copyright (c) 2013 Philip Yu. All rights reserved.
//

#import "UIView+Shadow.h"

@implementation UIView (Shadow)
/*设置view的阴影
 *shadowOpacity 阴影透明度(0 -1) Defaults to 0
 *shadowColor   阴影颜色   Defaults to opaque black
 *shadowRadius  阴影扩散的范围控制  Defaults to 3
 *shadowOffset  shadowOffset阴影偏移,x向右偏移4，y向下偏移4，默认(0, -3),这个跟          shadowRadius配合使用
 */
- (void)settingShadowOpacity:(float)shadowOpacity withShadowColor:(UIColor *)shadowColor wihtShadowRadius:(float)shadowRadius withshadowOffset:(CGSize)shadowOffset{
    
    self.layer.shadowOpacity =shadowOpacity;
    self.layer.shadowColor =shadowColor.CGColor;
    self.layer.shadowRadius =shadowRadius;
    self.layer.shadowOffset =shadowOffset;
}

- (void)settingRadiusWithShadowOpacity:(float)shadowOpacity withShadowColor:(UIColor *)shadowColor wihtShadowRadius:(float)shadowRadius withshadowOffset:(CGSize)shadowOffset withRadius:(float)radius {
    
    self.layer.shadowOpacity =shadowOpacity;
    self.layer.shadowColor =shadowColor.CGColor;
    self.layer.shadowRadius =shadowRadius;
    self.layer.shadowOffset =shadowOffset;
    self.layer.cornerRadius =radius;
//    self.clipsToBounds = YES;
}

@end
